message("11111111111111111111111  "  ${libs})

add_library(libavcodec SHARED IMPORTED )
set_target_properties(libavcodec PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libavcodec-58.so")

add_library(libavdevice SHARED IMPORTED )
set_target_properties(libavdevice PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libavdevice-58.so")

add_library(libavfilter SHARED IMPORTED )
set_target_properties(libavfilter PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libavfilter-7.so")

add_library(libavformat SHARED IMPORTED )
set_target_properties(libavformat PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libavformat-58.so")

add_library(libavutil SHARED IMPORTED )
set_target_properties(libavutil PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libavutil-56.so")

add_library(libpostproc SHARED IMPORTED )
set_target_properties(libpostproc PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libpostproc-55.so")

add_library(libswresample SHARED IMPORTED )
set_target_properties(libswresample PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libswresample-3.so")

add_library(libswscale SHARED IMPORTED )
set_target_properties(libswscale PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libswscale-5.so")

add_library(libmp4v2 SHARED IMPORTED )
set_target_properties(libmp4v2 PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libmp4v2.so")

add_library(libopencv_java3 SHARED IMPORTED )
set_target_properties(libopencv_java3 PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_java3.so")

add_library(libyuv SHARED IMPORTED )
set_target_properties(libyuv PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libyuv.so")

add_library(libjpeg SHARED IMPORTED )
set_target_properties(libjpeg PROPERTIES
    IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libjpeg.so")

add_library( # Sets the name of the library.
             jnimp4v2

             # Sets the library as a shared library.
             SHARED

             # Provides a relative path to your source file(s).
             jnimp4v2.cpp
             MP4Encoder.cpp
             ImageProc.cpp
             sonix_xu_ctrls.c
             mjpeg_decoder.cc
             convert_jpeg.cc)

target_link_libraries( # Specifies the target library.
                       jnimp4v2
                       libavcodec
                       libavdevice
                       libavfilter
                       libavformat
                       libavutil
                       libpostproc
                       libswresample
                       libswscale
                       libmp4v2
                       libopencv_java3
                       libyuv
                       libjpeg

                       # Links the target library to the log library
                       # included in the NDK.
                       ${log-lib} )